/*
** my_str_isprintable.c for my_str_isprintable in /home/nadali_t//local/piscine/Jour_06/ex_14
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Mon Oct  8 16:34:15 2012 thomas nadalie
** Last update Mon Nov 19 16:58:23 2012 thomas nadalie
*/

#include	"my.h"

int		my_str_isprintable(char *str)
{
  int		i;
  int		printable;
  int		other;

  i = 0;
  printable = 0;
  other = 0;
  while (str[i])
    {
      if (str[i] <= ' ' && str[i] >= '~')
	{
	  printable = printable + 1;
	  if (printable == my_strlen(str))
	    return (1);
	}
      else if (!(str[i] <= ' ' && str[i] >= '~'))
	{
	  other = other + 1;
	  if (other != 0)
	    return (0);
	}
      i = i + 1;
    }
  return (2);
}
